package com.zkthink.ceres.finance.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author vivi.huang
 * @since 2020-06-26
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_deposit_journal")
@ApiModel(value = "DepositJournal", description = "")
@AllArgsConstructor
public class DepositJournal extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 保证金类型 1：营销活动保证金
     */
    @ApiModelProperty(value = "保证金类型 1：营销活动保证金")
    @TableField("deposit_type")
    @Excel(name = "保证金类型 1：营销活动保证金")
    protected Integer depositType;

    /**
     * 活动id
     */
    @ApiModelProperty(value = "活动id")
    @TableField("promotion_id")
    @Excel(name = "活动id")
    protected Long promotionId;

    /**
     * 订单code,交易流水号
     */
    @ApiModelProperty(value = "交易流水号")
    @Length(max = 200, message = "交易流水号长度不能超过200")
    @TableField(value = "transaction_id", condition = LIKE)
    @Excel(name = "交易流水号")
    protected String transactionId;

    /**
     * 金额
     */
    @ApiModelProperty(value = "金额")
    @TableField("amount")
    @Excel(name = "金额")
    protected Long amount;

    /**
     * 保证金状态,0:冻结中，1:已退回
     */
    @ApiModelProperty(value = "保证金状态,0:冻结中，1:已退回")
    @TableField("state")
    @Excel(name = "保证金状态,0:冻结中，1:已退回")
    protected Integer state;


    @Builder
    public DepositJournal(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime, 
                    Integer depositType, Long promotionId, String transactionId, Long amount, Integer state) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.depositType = depositType;
        this.promotionId = promotionId;
        this.transactionId = transactionId;
        this.amount = amount;
        this.state = state;
    }

}
